package com.ningkang.ums.controller;

import com.ningkang.common.domain.ums.UserVo;
import com.ningkang.common.result.Result;
import com.ningkang.ums.domain.UserEntity;
import com.ningkang.ums.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserContorller
 * @Description 描述 用户控制层
 * @Author guoxin
 * @Date 2024/10/17 20:01
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    /**
     * 根据名称查询 用户是否存在
     */
    @GetMapping("/selectName/{username}")
    public Result<UserVo> selectName(@PathVariable("username") String username){
        UserVo userVo = userService.selectName(username);
        return Result.success(userVo);
    }
}
